home *** CD-ROM | disk | FTP | other *** search
-
- # dan heller program 4.4, p108
-
- # enter a command, execute it. place output in bottom window,
- # command in history list
-
- xtAppInitialize -class Program
-
- xmMainWindow .main managed
-
- # menu with one button in one pulldown
- xmMenuBar .main.menuBar managed
- xmCascadeButton .main.menuBar.file managed -labelString File
- xmPulldownMenu .main.filePane
- .main.menuBar.file setValues -subMenuId .main.filePane
- xmPushButton .main.filePane.quit managed -labelString Quit
- .main.filePane.quit activateCallback "exit 0"
-
- xmScrolledText .main.text managed \
- -rows 5 \
- -columns 40 \
- -editable False \
- -editMode Multi_line_edit
-
- # ?? dont know what dan is doing with userData
-
- xmCommand .main.command managed -promptString "Command:"
- .main.command commandEnteredCallback "exec_cmd {%value}"
-
- .main setValues -menuBar .main.menuBar \
- -commandWindow .main.command \
- -workWindow [.main.text parent]
-
- proc exec_cmd {command} {
-
- set comm_output [eval exec $command]
- .main.text setValues -value $comm_output
- }
-
- . realizeWidget
-
- . mainLoop
-